package com.dao;

import com.entity.ExamAnswerRecord;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * Version: V1.0    <br/>
 * Datetime:   2022/5/15 16:34   <br/>
 * Description: ${DES}
 *
 * @author: chen
 */
@Mapper
public interface ExamAnswerRecordMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(ExamAnswerRecord record);

    int insertSelective(ExamAnswerRecord record);

    ExamAnswerRecord selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(ExamAnswerRecord record);

    int updateByPrimaryKey(ExamAnswerRecord record);

    int deleteByExaminationPaperId(@Param("testPaperId") Integer testPaperId);

    /**
     * 根据试卷id和用户id查询试卷答题记录
     *
     * @param userId  用户id
     * @param paperId 试卷id
     * @return 试卷答题记录
     */
    ExamAnswerRecord selectByUserIdAndPaperId(@Param("userId") Integer userId, @Param("paperId") Integer paperId);

    Long countExamRecordTotalNumber(@Param("userId") Integer userId);

    List<ExamAnswerRecord> selectByPage(@Param("offset") Integer offset, @Param("pageSize") Integer pageSize, @Param("userId") Integer userId);
}